package java_design_model.com.Flyweight;

import java.util.ArrayList;
import java.util.HashMap;

public class B {
    HashMap<String,AA> aas=new HashMap<>();
    AA getAA(String color){
        AA aa;
        if(!aas.containsKey(color)){
            aa=new A(color);
            aas.put(color,aa);
        }else {
            aa=aas.get(color);
        }
        return aa;
    }
}
